<%--
  Created by IntelliJ IDEA.
  User: ct
  Date: 2019/5/7
  Time: 19:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.util.Map" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zxx">
<head>
    <title>主页</title>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8" />
    <link href="css/style1.css" rel="stylesheet" type="text/css" media="all" />
    <!-- <link href="//fonts.googleapis.com/css?family=Yanone+Kaffeesatz:200,300,400,700" rel="stylesheet"> -->
    <!-- <link href="//fonts.googleapis.com/css?family=Text+Me+One" rel="stylesheet"> -->
    <!-- <link href="//fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet"> -->

</head>
<body>
<%
    Map<String,String> usermessage = (Map<String, String>) request.getSession().getAttribute("usermessage");
    String email="";
    String sno="";
    String username="";
    String name="";
    String img="";
    if(usermessage == null) {
%>
<script type="text/javascript">
    alert(用户没有登陆);
</script>
<jsp:forward page="/login.html"/>
<%
    }
%>
<%
    if(usermessage != null)
    {

        for(String key : usermessage.keySet()){
            String value = usermessage.get(key);
            if (key.equals("password"))
                continue;
            else if(key.equals("email"))
            {
                email=value;
            }
            else if(key.equals("sno"))
            {
                sno=value;
            }
            else if(key.equals("name"))
            {
                name=value;
            }
            else if(key.equals("username"))
            {
                username=value;
            }
            else if(key.equals("img"))
            {
                img="/img/"+value;
            }

        }
    }
%>
<div class="main-section">
    <!-- <div class="heading">
    <h1>账户设置</h1>
    <h2>管理你的账户信息并设置邮箱</h2>
    </div> -->
    <div class="child-main">
        <div class="child-left">
            <img src="<%=img%>" alt="image">
            <p><%=name%></p>
            <form action="/uploadServlet" enctype="multipart/form-data" method ="post" >
                <span class="right-text">上传头像</span>
                <input type="file" name="file" style="margin: 8px 0">
                <input type="submit" name="upload" value="上传">
            </form>
        </div>
        <div class="child-right">
            <a href="/Servlet2" class="quit"><span>退出</span></a>
            <h3>账户设置</h3>
            <h5>管理你的账户信息并设置邮箱</h5>
            <p>个人信息</p>
            <ul class="address">
                <li>
                    <ul class="agileits-address-text ">
                        <li class="agile-it-adress-left"><b>用户名</b></li>
                        <li><span>:</span><%=username%></li>
                    </ul>
                </li>
                <li>
                    <ul class="agileits-address-text">
                        <li class="agile-it-adress-left"><b>邮箱</b></li>
                        <li><span>:</span><%=email%></li>
                    </ul>
                </li>
                <li>
                    <ul class="agileits-address-text">
                        <li class="agile-it-adress-left"><b>学号</b></li>
                        <li><span>:</span><%=sno%></li>
                    </ul>
                </li>

            </ul>
        </div>

        <div class="child-right">

            <p>绑定信息</p>
            <ul class="address">
                <li>
                    <ul class="agileits-address-text ">
                        <li class="agile-it-adress-left"><b>手机号</b></li>
                        <li><span>:</span>尚未绑定</li>
                    </ul>
                </li>
                <li>
                    <ul class="agileits-address-text">
                        <li class="agile-it-adress-left"><b>QQ</b></li>
                        <li><span>:</span>尚未绑定</li>
                    </ul>
                </li>
                <li>
                    <ul class="agileits-address-text">
                        <li class="agile-it-adress-left"><b>微信</b></li>
                        <li><span>:</span>尚未绑定</li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div class="footer-w3l">
    <p class="agileinfo"> &copy; 2019 DGUT | 陈钿 </p>
</div>





</body>
</html>
